<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><title>
 添加角色
</title><link href="<%=basePath%>Scripts/jqurey.ui/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" /><link href="../<%=basePath%>Styles/ts_css.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>Scripts/jquery.js" type="text/javascript"></script>
    <script src="<%=basePath%>Scripts/jquery.hotkeys.js" type="text/javascript"></script>
    <script src="<%=basePath%>Scripts/jstree/jquery.jstree.js" type="text/javascript"></script>
    <link href="<%=basePath%>Styles/Loading.css" rel="stylesheet" type="text/css" /><link href="../<%=basePath%>Styles/dialog.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>Scripts/jquery.dialog.js" type="text/javascript"></script>
    <script src="<%=basePath%>Scripts/error.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function(){
		$("#add").change(function(){
			var a = $("#add").val();
			 $.ajax({
	               type: "POST",
	               url: "RoleTest.do",
	               data: {a:a},
	               datatype: "json",
	               success: function(data){
	                   		if(data==1){
	                   			alert("角色已存在！");
	                   			$("#btn").hide();
	                   		}
	                   		if(data==0){
	                   			$("#btn").show();
	                   		}
	                  }
	            });
		});
	});
</script>
</head>
<body style="overflow-x: hidden; background: #EFF3FF; width: 100%">
    <div style="width: 100%; float: left;">
        <div class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons" style="width: 100%"
            role="tablist">
            <div>
                <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-state-active ui-corner-top"
                    role="tab" aria-expanded="true" aria-selected="true" tabindex="0">
                    <span class="ui-icon ui-icon-triangle-1-s"></span><a tabindex="-1">添加角色</a>
                </h3>
                <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active"
                    style="height: 100%;" role="tabpanel">
                    <form method="post" action="RoleAdd.do" id="form1">
	                    <div style="clear: both;" id="authorityClear">
	                   	  添加角色名称：<input name="roleName" type="text" id="add"/>
	                    </div>
	                    <br/><br/><br/>
	                    <div style="text-align: center;">
	                        <input type="submit" value="提交" class="button" id="btn"/>
	                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
